//
//  LinChartViewController.m
//  饼线柱状图
//
//  Created by ma c on 13/8/18.
//  Copyright © 2018年 子房. All rights reserved.
//

#import "LinChartViewController.h"

#import "SSWLineChartView.h"

@interface LinChartViewController ()<SSWChartsDelegate>

@end

@implementation LinChartViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self makeTheLineChartView];
    
}

-(void)makeTheLineChartView
{
    SSWLineChartView * lineChartView = [[SSWLineChartView alloc] initWithChartType:SSWChartsTypeLine];
    lineChartView.backgroundColor = [UIColor orangeColor];
    lineChartView.xValuesArr = [@[@"小麦",@"玉米",@"早籼稻",@"旱籼稻",
                                  @"大豆",@"小豆",@"小米",@"大米",
                                  @"菜籽",@"芝麻",@"高粱",@"甘蔗",
                                  @"豌豆",@"红豆",@"绿豆",@"青稞"] mutableCopy];
    lineChartView.yValuesArr = [@[@"100",@"200",@"300",
                                  @"60",@"460",@"368",
                                  @"235", @"222",@"100",
                                  @"200",@"300",@"500",
                                  @"136",@"366",@"350",
                                  @"450"] mutableCopy];
    lineChartView.unit = @"吨";
    lineChartView.yScaleValue = 60;
    lineChartView.delegate = self;
    lineChartView.frame = CGRectMake(0, 100, self.view.bounds.size.width, 300);
    [self.view addSubview:lineChartView];
    
}

- (void)SSWChartView:(SSWCharts *)chartView didSelectIndex:(NSInteger)index
{
    NSLog(@"点击的是 %ld",index);
}


@end
